What are LINQ Lambda Expressions for example?
What are LINQ Lambda Expressions for example?
311
24-Sep-2021
Ravi Vishwakarma
24-Sep-2021That is, Lambda Expression only provides the facility to specify the syntax of the Anonymous Method in a simple way. In place of the Anonymous Method, we can also use Lambda Expressions, which is more convenient to use than Anonymous Methods.
LINQ Lambda Expressions Syntax
Lambda Expression is dynamic variable and decides the type in compile time.
intAry.Where( x => x%2 == 0 );
in this example x is dynamic variable, and this expression { x%2 == 0 } check the x is even or odd.
Example
Output